#ifndef TAGGER_H
#define TAGGER_H

#include <QObject>
#include <QProcess>
#include <QTemporaryFile>

#include <libcorpus2/tagsetmanager.h>
#include <libcorpus2/io/reader.h>


class Tagger : public QObject
{
    Q_OBJECT
public:
    explicit Tagger(QObject *parent = 0);
    void tagFile(const QString &fileName);
    bool isTagging() {return tagging;}
    QStringList lexemQuery();

signals:
    void taggingCompleted(int exitCode);

public slots:
    void onWCRFTFinished(int exitCode, QProcess::ExitStatus exitStatus);

private:
    QTemporaryFile *taggingResult;
    QProcess *wcrft;
    bool tagging;

    mutable boost::shared_ptr<Corpus2::TokenReader> cclReader;
    Corpus2::Tagset tagset;
};

#endif // TAGGER_H
